414e5a1f6c829cc882e9651a08200cf9a53e2629,splice_machine/src/test/java/com/splicemachine/derby/impl/sql/execute/operations/JoinSelectionIT.java,JoinSelectionIT,testInnerJoinWithSubqueryFilterExactCriteria,#,142
Before Change
// should be NestedLoopJoin
@Test
public void testInnerJoinWithSubqueryFilterExactCriteria() throws Exception {
fourthRowContainsQuery(
format("explain select a2.pid from %s a2 join " +
"(select person.pid from %s) as a3 " +
" on a2.pid = a3.pid " +
" where a2.pid = 100", spliceTableWatcher2, spliceTableWatcher),
BROADCAST_JOIN, methodWatcher);
}
@Test
After Change
// should be NestedLoopJoin
@Test
public void testInnerJoinWithSubqueryFilterExactCriteria() throws Exception {
ResultSet rs = methodWatcher.executeQuery(
format("explain select a2.pid from %s a2 join " +
"(select person.pid from %s) as a3 " +
" on a2.pid = a3.pid " +
" where a2.pid = 100", spliceTableWatcher2, spliceTableWatcher));
int count = 0;
while (rs.next()) {
count++;
if (count == 4) {
String row = rs.getString(1);
String joinStrategy = row.substring(row.indexOf(PLAN_LINE_LEADER) + PLAN_LINE_LEADER.length(),
row.indexOf(JOIN_STRATEGY_TERMINATOR));
Assert.assertThat("Join strategy must be either NESTED_LOOP_JOIN or BROADCAST_JOIN", joinStrategy,
anyOf(equalTo(NESTED_LOOP_JOIN), equalTo(BROADCAST_JOIN)));
break;
}
}
}